package cn.linweijian.kafka.producerdemo.controller;

import cn.linweijian.kafka.producerdemo.common.ResponseResult;
import cn.linweijian.kafka.producerdemo.dto.TaskResult;
import cn.linweijian.kafka.producerdemo.service.PushTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description: kafkademo
 * <p>
 * Created by linweijian on 2018/6/4 14:15
 */
@RestController
@RequestMapping("/task")
public class TaskController {
    @Autowired
    private PushTaskService pushTaskService;

    @PostMapping("postTask")
    public ResponseResult postTask(@RequestBody TaskResult taskResult) {
        return pushTaskService.pushTask(taskResult);
    }
}
